#include <stdio.h>

int main() {
    unsigned long long target;
    scanf("%llu", &target);
    int digits[64];
    int length = 0;
    do {
        int currDigit = target % 10;
        digits[length] = currDigit;
        if (!(currDigit == 9 || currDigit == 1 || currDigit == 6 || currDigit == 8 || currDigit == 0)) {
            printf("No"); return 0;
        }
        target /= 10;
        length++;
    } while (target != 0);
    // 然后再逐位判断
    for (int i = 0; i < length; i++) {
        int accepted = (digits[i] == 9 && digits[length - i - 1] == 6)
        || (digits[i] == 6 && digits[length - i - 1] == 9)
        || (digits[i] == 1 && digits[length - i - 1] == 1)
        || (digits[i] == 8 && digits[length - i - 1] == 8)
        || (digits[i] == 0 && digits[length - i - 1] == 0);
        if (!accepted) {
            printf("No"); return 0;
        }
    }
    printf("Yes");
    return 0;
}